package com.yx.pc.api.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.yx.pc.api.service.PcTdSectionService;
import com.yx.system.dao.TdSectionMapper;
import com.yx.system.entity.TdSection;
import com.yx.system.service.TdSectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class PcTdSectionServiceImpl implements PcTdSectionService {

    @Autowired
    private TdSectionMapper tdSectionMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return tdSectionMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(TdSection record) {
        return tdSectionMapper.insert(record);
    }

    @Override
    public int insertSelective(TdSection record) {
        return tdSectionMapper.insertSelective(record);
    }

    @Override
    public TdSection selectByPrimaryKey(Integer id) {
        return tdSectionMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(TdSection record) {
        return tdSectionMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(TdSection record) {
        return tdSectionMapper.updateByPrimaryKey(record);
    }

    @Override
    public Page<TdSection> queryPageList(Page<TdSection> page, Map<String, Object> map) {
        page.setRecords(tdSectionMapper.queryPageList(page, map));
        return page;
    }

    @Override
    public List<TdSection> queryList(Map<String, Object> map) {
        return tdSectionMapper.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return tdSectionMapper.queryTotal(map);
    }

    @Override
    public List<TdSection> findByBookid(Integer bookid) {
        return tdSectionMapper.findByBookid(bookid);
    }

    @Override
    public List<TdSection> findByVolumeId(Integer id) {
        return tdSectionMapper.findByVolumeId(id);
    }

    @Override
    public List<Integer> findIdList(Integer bookid) {
        return tdSectionMapper.findIdList(bookid);
    }

    @Override
    public List<Integer> findSectionIds(Integer bookId) {
        return tdSectionMapper.findSectionIds(bookId);
    }
}
